/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import React, {Component} from 'react';
import {Dimensions} from 'react-native';
import { Toast, Icon } from 'antd-mobile-rn';

// project
import {
    CAround, CBetween, CCenter, CColumn, CHand, CItemX, CItemY, CLine, CRow, CWrap, 
    CIcon, CImage, CSvg, CText,
    CContent, CFloat, CFooter, CHeader, CPage, CSide, 
    CEmpty, CError, CFail, CSkeleton, 
    CLabel, CButton
} from '../../../library/comp';

import Licon from '../../../library/comp/project/icon';


/******************************************************************************************
 * Export
 ******************************************************************************************/

export default class PersonalData extends Component {

    /*------------------------------------------------------------------------------------
	 * 初始化
	 *-----------------------------------------------------------------------------------*/
    constructor(props) {
        super(props);
        this.Nav = this.props.navigation;

        /**
         * state
         */
        this.state = {
            id:1,
            phone:'15713028819',
            headImage:'https://wx4.sinaimg.cn/mw690/6909cd6dly1fp3jzs0r7rj20m80m8ww6.jpg',
        };
    }


    /*------------------------------------------------------------------------------------
	 * 生命周期
	 *-----------------------------------------------------------------------------------*/
    componentDidMount() {
        // SplashScreen.hide();
        
        // HttpTemp.get({
        //     url:'/CPage/user/detail.php',
        //     success:(res)=>{
        //         this.setState({
        //             headImage:res.data.object.set_head,
        //             phone:res.data.set_mobile,
        //             id:res.data.id
        //         })
        //         console.log('res++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++',res)
        //         console.log('this.state++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++',this.state)
        //     }
        // })
    }


    /*------------------------------------------------------------------------------------
	 * 渲染
	 *-----------------------------------------------------------------------------------*/
    render(){
        return(
            <CPage>

                <CContent bg='#efeff4' mt='96'>
                    <CHand df onPress={(e)=> {
                        Toast.info('您所在的小区暂未开启此功能', 1);
                    }}>
                        <CBetween bg='#fff' py='20' h='116' y='center' mt='16' mb='10' pa='20'>
                            <CHand w='92' h='92' ra='46' oh>
                                <CImage source={{uri:this.state.headImage}} w='92' h='92' ra='46' resizeMode='cover' style={{backgroundColor:'#efeff4'}}></CImage>
                            </CHand>
                            <CHand><CText color='#c9c9c9' size='26'>上传照片</CText></CHand>
                        </CBetween>
                    </CHand>

                    <CRow my='10'>
                        <CItemY f='1'>
                            <CHand w="750" onPress={(e)=> {
                                // 
                                // 
                                // 
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">昵称</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <CText color='#aeaeae' size='26'>{this.state.phone}</CText>
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                            <CHand w="750" onPress={(e)=> {
                                this.Nav.navigate('UserSettingConfirm')
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">实名认证</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        {/* <CText color='#aeaeae' size='13'>未验证</CText> */}
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                        </CItemY>
                    </CRow>
                    <CRow my='10'>
                        <CItemY f='1'>
                            <CHand w="750" onPress={(e)=> {
                                this.Nav.navigate('UserSettingHouse')
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">我的房屋</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                            <CHand w="750" onPress={(e)=> {
                                this.Nav.navigate('UserSettingCar')
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">我的车辆</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                        </CItemY>
                    </CRow>
                    <CRow my='10'>
                        <CItemY f='1'>
                            <CHand w="750">
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">手机号码</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <CText color='#aeaeae' size='26'>{this.state.phone.substring(0,3)+'****'+this.state.phone.substring(7,11)}</CText>
                                    </CHand>
                                </CBetween>
                            </CHand>
                            <CHand w="750" onPress={(e)=> {
                                Toast.info('您所在的小区暂未开启此功能', 1);
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">修改密码</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                            <CHand w="750" onPress={(e)=> {
                                Toast.info('您所在的小区暂未开启此功能', 1);
                            }}>
                                <CBetween pa='30' h='86' bb='solid 2 #f0f0f0' bg='#fff' f='1'>
                                    <CHand x='left' y='center'>
                                        <CText color='#333' size="26">设置支付密码</CText>
                                    </CHand>
                                    <CHand x='right' y='center'>
                                        <Icon type='right' size='xxs' color='#b2b2b2'></Icon>
                                    </CHand>
                                </CBetween>
                            </CHand>
                        </CItemY>
                    </CRow>
                    

                </CContent>

                {/* 顶部 star */}
                <CHeader h='96' y='center' bg='#fff'>
                    <CBetween px='20'>
                            

                        <CHand onPress={(e)=> {
                            this.Nav.goBack()
                        }}>
                            <Icon type='left' size='md' color='#00CC66' />
                        </CHand>

                        <CText size='34'>个人资料</CText>
                        <CHand w='44' h='44'></CHand>
                    </CBetween>
                </CHeader>
                {/* 顶部 star */}

            </CPage>
        )
    }
}
